home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume10 / b+tree / Patch-for-unix next >
Encoding:
Text File  |  1990-01-21  |  9.2 KB  |  345 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Intelligent Software Products, Inc.
  3. subject: v10i032: b+tree mgr patches for SCO Xenix and System V
  4. from: jbayer@ispi.UUCP (Jonathan Bayer)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 10, Issue 32
  8. Submitted-by: jbayer@ispi.UUCP (Jonathan Bayer)
  9. Archive-name: b+tree/Patch-for-unix
  10.  
  11. These are the diffs necessary to make the b+tree package run on Xenix,
  12. and probably on any System V based system.
  13.  
  14. The main problem was that the parameters to memcpy() were reversed, causing
  15. the key to NOT be copied into the database.
  16.  
  17.  
  18. JB
  19.  
  20.  
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then unpack
  23. # it by saving it into a file and typing "sh file".  To overwrite existing
  24. # files, type "sh file -c".  You can also feed this as standard input via
  25. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  26. # will see the following message at the end:
  27. #        "End of shell archive."
  28. # Contents:  README.XENIX btdbmlib/diffs btlib/diffs utils/diffs
  29. # Wrapped by Jonathan Bayer@ispi on Sun Jan 21 14:00:53 1990
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'README.XENIX' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'README.XENIX'\"
  33. else
  34. echo shar: Extracting \"'README.XENIX'\" \(241 characters\)
  35. sed "s/^X//" >'README.XENIX' <<'END_OF_FILE'
  36. X
  37. XThese are the diffs necessary to make the b+tree package run on Xenix,
  38. Xand probably on any System V based system.
  39. X
  40. XThe main problem was that the parameters to memcpy() were reversed, causing
  41. Xthe key to NOT be copied into the database.
  42. X
  43. X
  44. XJB
  45. END_OF_FILE
  46. if test 241 -ne `wc -c <'README.XENIX'`; then
  47.     echo shar: \"'README.XENIX'\" unpacked with wrong size!
  48. fi
  49. # end of 'README.XENIX'
  50. fi
  51. if test -f 'btdbmlib/diffs' -a "${1}" != "-c" ; then 
  52.   echo shar: Will not clobber existing file \"'btdbmlib/diffs'\"
  53. else
  54. echo shar: Extracting \"'btdbmlib/diffs'\" \(1104 characters\)
  55. sed "s/^X//" >'btdbmlib/diffs' <<'END_OF_FILE'
  56. X*** orig/Makefile    Sun Jan 21 12:34:01 1990
  57. X--- Makefile    Sat Jan 20 20:23:17 1990
  58. X***************
  59. X*** 34,40 ****
  60. X  CFILES=    btdbmclose.c \
  61. X      btdbmdelete.c \
  62. X      btdbmfetch.c \
  63. X!     btdbmfirstkey.c \
  64. X      btdbmnextkey.c \
  65. X      btdbmopen.c \
  66. X      btdbmstore.c \
  67. X--- 34,40 ----
  68. X  CFILES=    btdbmclose.c \
  69. X      btdbmdelete.c \
  70. X      btdbmfetch.c \
  71. X!     btdbmfrstkey.c \
  72. X      btdbmnextkey.c \
  73. X      btdbmopen.c \
  74. X      btdbmstore.c \
  75. X***************
  76. X*** 65,71 ****
  77. X  OFILES=    btdbmclose.o \
  78. X      btdbmdelete.o \
  79. X      btdbmfetch.o \
  80. X!     btdbmfirstkey.o \
  81. X      btdbmnextkey.o \
  82. X      btdbmopen.o \
  83. X      btdbmstore.o \
  84. X--- 65,71 ----
  85. X  OFILES=    btdbmclose.o \
  86. X      btdbmdelete.o \
  87. X      btdbmfetch.o \
  88. X!     btdbmfrstkey.o \
  89. X      btdbmnextkey.o \
  90. X      btdbmopen.o \
  91. X      btdbmstore.o \
  92. X*** orig/btdbmfirstkey.    Sun Jan 21 12:33:47 1990
  93. X--- btdbmfrstkey.c    Sat Jan 20 10:15:56 1990
  94. X***************
  95. X*** 35,37 ****
  96. X--- 35,38 ----
  97. X      ret = btdbm_nextkey(db);
  98. X      return(ret);
  99. X  }
  100. X+ 
  101. X*** orig/stoconf.h    Sun Jan 21 12:33:50 1990
  102. X--- stoconf.h    Sat Jan 20 20:20:59 1990
  103. X***************
  104. X*** 40,42 ****
  105. X--- 40,44 ----
  106. X  
  107. X  #define    _DEF_STO_CONF_H
  108. X  #endif
  109. X+ 
  110. X+ #include    <fcntl.h>
  111. END_OF_FILE
  112. if test 1104 -ne `wc -c <'btdbmlib/diffs'`; then
  113.     echo shar: \"'btdbmlib/diffs'\" unpacked with wrong size!
  114. fi
  115. # end of 'btdbmlib/diffs'
  116. fi
  117. if test -f 'btlib/diffs' -a "${1}" != "-c" ; then 
  118.   echo shar: Will not clobber existing file \"'btlib/diffs'\"
  119. else
  120. echo shar: Extracting \"'btlib/diffs'\" \(2637 characters\)
  121. sed "s/^X//" >'btlib/diffs' <<'END_OF_FILE'
  122. X*** orig/btconf.h    Sun Jan 21 12:34:04 1990
  123. X--- btconf.h    Sat Jan 20 20:29:47 1990
  124. X***************
  125. X*** 65,85 ****
  126. X  /*
  127. X  choose one of these as your favorite memory copying function
  128. X  can you believe 3 functions, 3 names, all do the same thing ?
  129. X- 
  130. X- #define    USE_MEMCPY    1
  131. X- #define    USE_MOVEMEM    1
  132. X  */
  133. X! #define    USE_BCOPY    1
  134. X  
  135. X  /*
  136. X  if the operating system the software will be running under supports
  137. X  the ftruncate(2) system call to free a file's allocated space after
  138. X  a certain length, turn this option on, and bt_zap() will free extra
  139. X  space when called.
  140. X- #define    USE_FTRUNCATE    0
  141. X  */
  142. X! #define    USE_FTRUNCATE    1
  143. X  
  144. X  /*
  145. X  the default page size. usually use BUFSIZ or maybe (BUFSIZ * 2)
  146. X  considerations are:: as buffer size increases, memory use for
  147. X--- 65,86 ----
  148. X  /*
  149. X  choose one of these as your favorite memory copying function
  150. X  can you believe 3 functions, 3 names, all do the same thing ?
  151. X  */
  152. X! #define    USE_MEMCPY    1
  153. X! /* #define    USE_MOVEMEM    1 */
  154. X  
  155. X+ /* #define    USE_BCOPY    1 */
  156. X+ 
  157. X  /*
  158. X  if the operating system the software will be running under supports
  159. X  the ftruncate(2) system call to free a file's allocated space after
  160. X  a certain length, turn this option on, and bt_zap() will free extra
  161. X  space when called.
  162. X  */
  163. X! /* #define    USE_FTRUNCATE    0
  164. X  
  165. X+ /* #define    USE_FTRUNCATE    1 */
  166. X+ 
  167. X  /*
  168. X  the default page size. usually use BUFSIZ or maybe (BUFSIZ * 2)
  169. X  considerations are:: as buffer size increases, memory use for
  170. X***************
  171. X*** 140,142 ****
  172. X--- 141,146 ----
  173. X  
  174. X  #define    _DEF_BT_CONFIG_H
  175. X  #endif
  176. X+ 
  177. X+ #define        u_long    long
  178. X+ #include    <fcntl.h>
  179. X*** orig/btinsert.c    Sun Jan 21 12:34:08 1990
  180. X--- btinsert.c    Sun Jan 21 12:27:52 1990
  181. X***************
  182. X*** 71,77 ****
  183. X      (void)bcopy((char *)key,(char *)kp1,len);
  184. X  #endif
  185. X  #ifdef    USE_MEMCPY
  186. X!     (void)memcpy((char *)key,(char *)kp1,len);
  187. X  #endif
  188. X  #ifdef    USE_MOVEMEM
  189. X      (void)movemem((char *)key,(char *)kp1,len);
  190. X--- 71,77 ----
  191. X      (void)bcopy((char *)key,(char *)kp1,len);
  192. X  #endif
  193. X  #ifdef    USE_MEMCPY
  194. X!     (void)memcpy((char *)kp1,(char *)key,len);
  195. X  #endif
  196. X  #ifdef    USE_MOVEMEM
  197. X      (void)movemem((char *)key,(char *)kp1,len);
  198. X*** orig/btpage2.c    Sun Jan 21 12:34:12 1990
  199. X--- btpage2.c    Sun Jan 21 12:28:22 1990
  200. X***************
  201. X*** 152,158 ****
  202. X      (void)bcopy((char *)cp,(char *)dbuf,*dlen);
  203. X  #endif
  204. X  #ifdef    USE_MEMCPY
  205. X!     (void)memcpy((char *)cp,(char *)dbuf,*dlen);
  206. X  #endif
  207. X  #ifdef    USE_MOVEMEM
  208. X      (void)movemem((char *)cp,(char *)dbuf,*dlen);
  209. X--- 152,158 ----
  210. X      (void)bcopy((char *)cp,(char *)dbuf,*dlen);
  211. X  #endif
  212. X  #ifdef    USE_MEMCPY
  213. X!     (void)memcpy((char *)dbuf,(char *)cp,*dlen);
  214. X  #endif
  215. X  #ifdef    USE_MOVEMEM
  216. X      (void)movemem((char *)cp,(char *)dbuf,*dlen);
  217. END_OF_FILE
  218. if test 2637 -ne `wc -c <'btlib/diffs'`; then
  219.     echo shar: \"'btlib/diffs'\" unpacked with wrong size!
  220. fi
  221. # end of 'btlib/diffs'
  222. fi
  223. if test -f 'utils/diffs' -a "${1}" != "-c" ; then 
  224.   echo shar: Will not clobber existing file \"'utils/diffs'\"
  225. else
  226. echo shar: Extracting \"'utils/diffs'\" \(2305 characters\)
  227. sed "s/^X//" >'utils/diffs' <<'END_OF_FILE'
  228. X*** orig/btest.c    Sun Jan 21 12:34:21 1990
  229. X--- btest.c    Sat Jan 20 20:31:52 1990
  230. X***************
  231. X*** 42,47 ****
  232. X--- 42,51 ----
  233. X  #include    "btconf.h"
  234. X  #include    "btintern.h"
  235. X  
  236. X+ #ifdef    M_XENIX
  237. X+ #define    rindex    strrchr
  238. X+ #endif
  239. X+ 
  240. X  #ifndef    lint
  241. X  static char *rcsid = "$Header: /atreus/mjr/hacks/btree/utils/RCS/btest.c,v 1.1 89/10/24 10:09:28 mjr Rel $";
  242. X  #endif
  243. X*** orig/btoptim.c    Sun Jan 21 12:34:07 1990
  244. X--- btoptim.c    Sun Jan 21 01:40:57 1990
  245. X***************
  246. X*** 2,7 ****
  247. X--- 2,8 ----
  248. X  #include    <ctype.h>
  249. X  #include    <sys/types.h>
  250. X  #include    <sys/file.h>
  251. X+ #include    <fcntl.h>
  252. X  #include    "btree.h"
  253. X  
  254. X  /*
  255. X*** orig/dbtest.c    Sun Jan 21 12:34:11 1990
  256. X--- dbtest.c    Sat Jan 20 20:34:06 1990
  257. X***************
  258. X*** 2,7 ****
  259. X--- 2,8 ----
  260. X  #include    <ctype.h>
  261. X  #include    <sys/types.h>
  262. X  #include    <sys/file.h>
  263. X+ #include    <fcntl.h>
  264. X  #include    "btdbm.h"
  265. X  
  266. X  /*
  267. X*** orig/rectest.c    Sun Jan 21 12:34:14 1990
  268. X--- rectest.c    Sat Jan 20 20:32:40 1990
  269. X***************
  270. X*** 2,7 ****
  271. X--- 2,8 ----
  272. X  #include    <ctype.h>
  273. X  #include    <sys/types.h>
  274. X  #include    <sys/file.h>
  275. X+ #include    <fcntl.h>
  276. X  #include    "store.h"
  277. X  
  278. X  /*
  279. X*** orig/testrack.c    Sun Jan 21 12:34:15 1990
  280. X--- testrack.c    Sun Jan 21 12:25:11 1990
  281. X***************
  282. X*** 1,6 ****
  283. X  #include    <stdio.h>
  284. X- #include    <sys/file.h>
  285. X  #include    <sys/types.h>
  286. X  #include    "btree.h"
  287. X  
  288. X  /*
  289. X--- 1,7 ----
  290. X  #include    <stdio.h>
  291. X  #include    <sys/types.h>
  292. X+ #include    <sys/file.h>
  293. X+ #include    <fcntl.h>
  294. X  #include    "btree.h"
  295. X  
  296. X  /*
  297. X***************
  298. X*** 13,19 ****
  299. X            distributed in accordance with the terms listed in
  300. X            the COPYRIGHT document.
  301. X  */
  302. X! 
  303. X  
  304. X  #ifndef    lint
  305. X  static char *rcsid = "$Header: /atreus/mjr/hacks/btree/utils/RCS/testrack.c,v 1.1 89/10/24 10:09:25 mjr Rel $";
  306. X--- 14,22 ----
  307. X            distributed in accordance with the terms listed in
  308. X            the COPYRIGHT document.
  309. X  */
  310. X! #ifdef    M_XENIX
  311. X! #define    index    strchr
  312. X! #endif
  313. X  
  314. X  #ifndef    lint
  315. X  static char *rcsid = "$Header: /atreus/mjr/hacks/btree/utils/RCS/testrack.c,v 1.1 89/10/24 10:09:25 mjr Rel $";
  316. X*** orig/words.c    Sun Jan 21 12:33:59 1990
  317. X--- words.c    Sun Jan 21 01:40:30 1990
  318. X***************
  319. X*** 11,16 ****
  320. X--- 11,21 ----
  321. X            the COPYRIGHT document.
  322. X  */
  323. X  
  324. X+ #ifdef    M_XENIX
  325. X+ #define    random    rand
  326. X+ #define    srandom    srand
  327. X+ #endif
  328. X+ 
  329. X  
  330. X  extern    long    random();
  331. X  extern    long    time();
  332. END_OF_FILE
  333. if test 2305 -ne `wc -c <'utils/diffs'`; then
  334.     echo shar: \"'utils/diffs'\" unpacked with wrong size!
  335. fi
  336. # end of 'utils/diffs'
  337. fi
  338. echo shar: End of shell archive.
  339. exit 0
  340. -- 
  341. Jonathan Bayer        Intelligent Software Products, Inc.
  342. (201) 245-5922        500 Oakwood Ave.
  343. jbayer@ispi.COM        Roselle Park, NJ   07204    
  344.  
  345.